#!/usr/bin/env python
# -*- encoding: utf-8 -*-

lines = ["first line\n", "second line\n", "third line\n"]
f = file("t1.txt", "w")
f.writelines(lines)

f.close()

